package com.truesai.entities.inventory;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
 * 入库批次总表<br/>
 * 需求分析<br/>
 * <strong>唯一性:</strong>批次编码<br/>
 * 该表主要入库批次总信息。
 * @author XuLian
 *
 */
@Entity
@NamedQueries(
{
        @NamedQuery(name = Inventory.ALL, query = "Select i from Inventory i"),
        @NamedQuery(name = Inventory.BY_PRODUCTION, query = "Select i from Inventory i where i.batchCode = :batchCode"),
        @NamedQuery(name = Inventory.BY_ID, query = "Select i from Inventory i where i.id = :id") })
@Table(name = "Inventorys")
public class Inventory {
	
	public static final String ALL = "Inventory.all";

    public static final String BY_PRODUCTION = "Inventory.byBatchCode";

    public static final String BY_ID = "Inventory.byId";
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    /**批次编码*/
    @Column
    private String batchCode;
    
    /**进货批次*/
    @Column
    private Date inDate;
    
    public Inventory() {}
    
    public Inventory(String batchCode, Date inDate) {
    	this.batchCode = batchCode;
    	this.inDate = inDate;
    }

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getBatchCode() {
		return batchCode;
	}

	public void setBatchCode(String batchCode) {
		this.batchCode = batchCode;
	}

	public Date getInDate() {
		return inDate;
	}

	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}

}
